package com.ljf.tijian.service;

import com.ljf.tijian.ApiResponse;
import com.ljf.tijian.mapper.HospitalMapper;
import com.ljf.tijian.pojo.Hospital;
import com.ljf.tijian.service.Impl.HospitalServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HospitalService implements HospitalServiceImpl {


    @Autowired
    HospitalMapper hospitalMapper;

    @Override
    public ApiResponse listAll() {
        List<Hospital> hospitallist = hospitalMapper.selectAll();
        return new ApiResponse(200,"SUCCESS",hospitallist);
    }

    @Override
    public ApiResponse getHospitalById(Hospital hospital) {
        return new ApiResponse(200,"SUCCESS",hospitalMapper.selectByPrimaryKey(hospital.getHpId()));
    }


}
